import { highlightcodeele } from "./highlightcodeele";
import { highlightmath } from "./highlightmath";
import { mathclass } from "./mathclass";

export default async function highlightcodeormath(
    code: HTMLElement,
    pre: HTMLElement | null,

    stylecssrules: Set<string>
) {
    const element = code;
    if (mathclass.some((c) => element.classList.contains(c))) {
        await highlightmath(element, stylecssrules, pre);

        return;
    } else {
        return await highlightcodeele(element);
    }
}
